-------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/mkuhn/Dropbox (University of Oregon)/AlexAndyMike_Groceries/Submission/REStat/Pub Material/Data & Cod
> e/BFS Results.log
  log type:  text
 opened on:   9 Jan 2023, 13:33:49

. 
. *** Section 1 ***
. 
. *Percentage overall effect of full behavioral food subsidy
. xtreg TotalTFV i.AltTreatmentCode i.Study Baseline_TotalTFV i.Wave, re ///
>         cl(agentid)
note: 2.Study omitted because of collinearity
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      2,767
Group variable: agentid                         Number of groups  =        805

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1360                                         avg =        3.4
     overall = 0.0893                                         max =          4

                                                Wald chi2(14)     =     198.31
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                   (Std. Err. adjusted for 805 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
 AltTreatmentCode |
               2  |   5.112843   .8119605     6.30   0.000     3.521429    6.704256
               3  |   5.951036    .775277     7.68   0.000     4.431521    7.470551
               4  |   8.229984   .9965215     8.26   0.000     6.276838    10.18313
               5  |   7.336284   .9171576     8.00   0.000     5.538689     9.13388
               6  |   6.148292   1.037565     5.93   0.000     4.114701    8.181882
               7  |   7.137645    1.07998     6.61   0.000     5.020924    9.254367
                  |
          2.Study |          0  (omitted)
Baseline_TotalTFV |   .1552443   .0488282     3.18   0.001     .0595427    .2509458
                  |
             Wave |
               2  |  -.6773449   1.321754    -0.51   0.608    -3.267934    1.913244
               3  |  -1.485187   1.009244    -1.47   0.141    -3.463268    .4928947
               4  |    1.22813   1.647334     0.75   0.456    -2.000586    4.456846
               5  |  -2.227207    1.00978    -2.21   0.027     -4.20634   -.2480743
               6  |  -2.674159   .9431864    -2.84   0.005     -4.52277   -.8255477
               7  |  -3.651046   .7889984    -4.63   0.000    -5.197454   -2.104638
               8  |  -2.896822   1.443911    -2.01   0.045    -5.726834    -.066809
              10  |          0  (omitted)
                  |
            _cons |   4.127798   .7377736     5.59   0.000     2.681788    5.573807
------------------+----------------------------------------------------------------
          sigma_u |  6.1830495
          sigma_e |  8.4009293
              rho |  .35136115   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. nlcom (effect: _b[4.AltTreatmentCode]/_b[_cons])

      effect:  _b[4.AltTreatmentCode]/_b[_cons]

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |   1.993796   .4971538     4.01   0.000     1.019392    2.968199
------------------------------------------------------------------------------

. 
. *Percentage effect of full behavioral subsidy relative to subsidy alone
. nlcom (effect: _b[4.AltTreatmentCode]/_b[2.AltTreatmentCode] - 1)

      effect:  _b[4.AltTreatmentCode]/_b[2.AltTreatmentCode] - 1

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |    .609669   .2723433     2.24   0.025      .075886    1.143452
------------------------------------------------------------------------------

. 
. *Percentage overall effect of regular subsidies: see Table 3 code 
. nlcom (effect: _b[2.AltTreatmentCode]/_b[_cons])

      effect:  _b[2.AltTreatmentCode]/_b[_cons]

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |   1.238637   .3604887     3.44   0.001     .5320921    1.945182
------------------------------------------------------------------------------

. 
. *Fraction reporting a desire to increase FV consumption 
.         *A number of people completed most of the baseline survey without making 
.         *it to the end and being assigned a treatment.  We drop them here first.
. drop if BaselineDate == .
(2 observations deleted)

. drop if BaselineTreatment == "" & AltTreatmentCode == .
(10 observations deleted)

. egen id_tag = tag(agentid)

. tab MoreTFV if id_tag == 1

  Q9: Do you think your food |
    household eats the right |
amount of fruits and vegetab |      Freq.     Percent        Cum.
-----------------------------+-----------------------------------
      No, we should eat less |          5        0.45        0.45
      No, we should eat more |        910       82.43       82.88
Yes, we eat the right amount |        189       17.12      100.00
-----------------------------+-----------------------------------
                       Total |      1,104      100.00

. 
. *Fraction of sample choosing FV Subsidy 
.         *First need to create indicator variable for agency
. gen choice = (AltTreatmentCode > 2 & AltTreatmentCode < 6) if ///
>         AltTreatmentCode != .
(299 missing values generated)

. sum TFV if choice == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         TFV |      1,188    .7794613    .4147845          0          1

. 
. *Percentage effect of subsidy with agency relative to subsidy without
.         *First need to create indicator variables for subsidy and waiting period
.         *in order to estimate regression this comes from (Table 3)
. gen Subsidy = (AltTreatmentCode > 1) if AltTreatmentCode != . 
(299 missing values generated)

. gen wp = (AltTreatmentCode > 3 & AltTreatmentCode < 6 | ///
>         AltTreatmentCode == 7) if AltTreatmentCode != .
(299 missing values generated)

. xtreg TotalTFV Subsidy choice wp Baseline_TotalTFV i.Study i.Wave, re ///
>         cl(agentid)
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      2,767
Group variable: agentid                         Number of groups  =        805

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1355                                         avg =        3.4
     overall = 0.0883                                         max =          4

                                                Wald chi2(12)     =     198.00
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                   (Std. Err. adjusted for 805 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          Subsidy |   5.113028   .8118253     6.30   0.000     3.521879    6.704176
           choice |   1.063934   .8705137     1.22   0.222    -.6422419    2.770109
               wp |   1.455984   .6715608     2.17   0.030     .1397486    2.772219
Baseline_TotalTFV |   .1541921   .0489429     3.15   0.002     .0582658    .2501185
          2.Study |   .7897632   .9976805     0.79   0.429    -1.165655    2.745181
                  |
             Wave |
               2  |  -.7469758   1.309196    -0.57   0.568    -3.312952    1.819001
               3  |  -1.469004   1.011086    -1.45   0.146    -3.450696    .5126879
               4  |   1.197415   1.636768     0.73   0.464    -2.010591    4.405421
               5  |  -2.228685   1.018122    -2.19   0.029    -4.224168   -.2332025
               6  |  -2.752285   .9511409    -2.89   0.004    -4.616487   -.8880832
               7  |  -3.802685   .7861954    -4.84   0.000    -5.343599    -2.26177
               8  |  -2.940907     1.4391    -2.04   0.041    -5.761491   -.1203219
              10  |          0  (omitted)
                  |
            _cons |   4.161999   .7400324     5.62   0.000     2.711562    5.612436
------------------+----------------------------------------------------------------
          sigma_u |  6.1733344
          sigma_e |  8.4009293
              rho |  .35064473   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. nlcom (effect: _b[choice]/_b[Subsidy])

      effect:  _b[choice]/_b[Subsidy]

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |   .2080829    .192088     1.08   0.279    -.1684026    .5845684
------------------------------------------------------------------------------

. 
. *Percentage effect of subsidy with waiting period relative to subsidy without
. nlcom (effect: _b[wp]/_b[Subsidy])

      effect:  _b[wp]/_b[Subsidy]

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |   .2847596   .1387917     2.05   0.040     .0127329    .5567862
------------------------------------------------------------------------------

.         
. *Percentage effect of subsidy with early choice waiting period relative to 
. *subsidy with delayed choice waiting period
.         *First need to create indicator variables for delayed and early choices
. gen early = (AltTreatmentCode == 4)

. gen delayed = (AltTreatmentCode == 5)

. xtreg TotalTFV delayed early Baseline_TotalTFV i.Wave if ///
>         AltTreatmentCode == 2 | AltTreatmentCode == 4 | ///
>         AltTreatmentCode == 5, re cl(agentid)

Random-effects GLS regression                   Number of obs     =      1,075
Group variable: agentid                         Number of groups  =        327

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.0629                                         avg =        3.3
     overall = 0.0457                                         max =          4

                                                Wald chi2(10)     =          .
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =          .

                                   (Std. Err. adjusted for 327 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          delayed |   2.422614   1.040028     2.33   0.020     .3841964    4.461031
            early |   3.184744   1.080224     2.95   0.003     1.067543    5.301945
Baseline_TotalTFV |   .0980327   .0725235     1.35   0.176    -.0441108    .2401762
                  |
             Wave |
               2  |  -.7249537   1.954476    -0.37   0.711    -4.555656    3.105749
               3  |  -1.395472   1.295259    -1.08   0.281    -3.934133    1.143189
               4  |   1.889562   2.714048     0.70   0.486    -3.429873    7.208998
               5  |  -1.304094   1.512427    -0.86   0.389    -4.268397    1.660209
               6  |  -1.816024   1.416179    -1.28   0.200    -4.591683    .9596349
               7  |  -4.637705    1.12462    -4.12   0.000     -6.84192    -2.43349
               8  |  -2.603296   2.352421    -1.11   0.268    -7.213956    2.007364
              10  |          0  (empty)
                  |
            _cons |   9.323982   .9137571    10.20   0.000     7.533051    11.11491
------------------+----------------------------------------------------------------
          sigma_u |  5.9288766
          sigma_e |  9.0430655
              rho |  .30062426   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. nlcom (effect: _b[early]/_b[delayed])

      effect:  _b[early]/_b[delayed]

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |    1.31459   .5757544     2.28   0.022     .1861323    2.443048
------------------------------------------------------------------------------

.         
. *** Section 2.4 ***
. 
. *Subjects completing Part 1 baseline
. sum agentid if Study == 1 & id_tag == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
     agentid |        804    977242.5    275105.8      30589    1227285

. 
. *Subjects completing Part 2 baseline
. sum agentid if Study == 2 & id_tag == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
     agentid |        300     1156425      290046     104809    1393914

. 
. *Percentage reporting any food insecurity at baseline
.         *First need to make food security numerical
. gen insecure_any = (FoodSecure != "Almost never") if FoodSecure != ""

. sum insecure_any if id_tag == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
insecure_any |      1,104    .6730072    .4693272          0          1

. 
. *Fraction reporting a desire to increase FV consumption
. tab MoreTFV if id_tag == 1

  Q9: Do you think your food |
    household eats the right |
amount of fruits and vegetab |      Freq.     Percent        Cum.
-----------------------------+-----------------------------------
      No, we should eat less |          5        0.45        0.45
      No, we should eat more |        910       82.43       82.88
Yes, we eat the right amount |        189       17.12      100.00
-----------------------------+-----------------------------------
                       Total |      1,104      100.00

. 
. *Fraction reporting SNAP participation  
. tab SNAP if id_tag == 1

       SNAP |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        668       60.51       60.51
          1 |        436       39.49      100.00
------------+-----------------------------------
      Total |      1,104      100.00

. 
. *Fraction male
. tab Male if id_tag == 1

       Male |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        920       83.33       83.33
          1 |        184       16.67      100.00
------------+-----------------------------------
      Total |      1,104      100.00

. 
. *Fraction outside medium/large urban areas
.         *First need to create relevant indicator
. gen urban = (CitySize > 2) if CitySize != .

. tab urban if id_tag == 1

      urban |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        581       52.63       52.63
          1 |        523       47.37      100.00
------------+-----------------------------------
      Total |      1,104      100.00

. 
. *** Section 4 ***
. 
. *Treatment FV spending means
. sum TotalTFV if AltTreatmentCode == 1 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        388    4.028389    6.707003          0     56.255

. sum TotalTFV if AltTreatmentCode == 2

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        360    8.668861    9.541499          0      69.47

. sum TotalTFV if AltTreatmentCode == 3 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        473    9.312791    10.06646          0      50.78

. sum TotalTFV if AltTreatmentCode == 5  

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        366    10.63828    10.94697          0     50.375

. sum TotalTFV if AltTreatmentCode == 4

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        349    12.17301    12.39823          0      65.79

. sum TotalTFV if AltTreatmentCode == 6  

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        453    11.22618     11.3553          0         64

. sum TotalTFV if AltTreatmentCode == 7 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        378    12.19688    11.80262          0      59.79

. 
. *** Section 4.1 ***
. 
. *Table 2, Panel A
.         *First need to create a variable for number of Weeks a shopper completes
. egen MaxWeek = max(Week), by(agentid)
(299 missing values generated)

. sum TotalTFV if AltTreatmentCode == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        388    4.028389    6.707003          0     56.255

. scalar c_sd = `r(sd)'

. xtreg TotalTFV Subsidy i.Study , re cl(agentid)

Random-effects GLS regression                   Number of obs     =      2,767
Group variable: agentid                         Number of groups  =        805

R-sq:                                           Obs per group:
     within  =      .                                         min =          1
     between = 0.0807                                         avg =        3.4
     overall = 0.0492                                         max =          4

                                                Wald chi2(2)      =     137.87
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                              (Std. Err. adjusted for 805 clusters in agentid)
------------------------------------------------------------------------------
             |               Robust
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     Subsidy |   6.107802   .6013817    10.16   0.000     4.929116    7.286489
     2.Study |   1.621818   .6993661     2.32   0.020     .2510853     2.99255
       _cons |   4.022626   .4760284     8.45   0.000     3.089627    4.955624
-------------+----------------------------------------------------------------
     sigma_u |  6.4292718
     sigma_e |  8.4009293
         rho |   .3693603   (fraction of variance due to u_i)
------------------------------------------------------------------------------

. xtreg TotalTFV Subsidy i.Study Baseline_TotalTFV, re cl(agentid)

Random-effects GLS regression                   Number of obs     =      2,767
Group variable: agentid                         Number of groups  =        805

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1056                                         avg =        3.4
     overall = 0.0660                                         max =          4

                                                Wald chi2(3)      =     152.00
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                   (Std. Err. adjusted for 805 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          Subsidy |   6.326452   .6035113    10.48   0.000     5.143592    7.509313
          2.Study |   1.351107   .6854554     1.97   0.049     .0076389    2.694575
Baseline_TotalTFV |   .1577918   .0512196     3.08   0.002     .0574032    .2581805
            _cons |   3.046586   .5326558     5.72   0.000       2.0026    4.090572
------------------+----------------------------------------------------------------
          sigma_u |  6.2932407
          sigma_e |  8.4009293
              rho |  .35945455   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. xtreg TotalTFV Subsidy i.Study Baseline_TotalTFV i.Wave, re cl(agentid)
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      2,767
Group variable: agentid                         Number of groups  =        805

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1259                                         avg =        3.4
     overall = 0.0815                                         max =          4

                                                Wald chi2(10)     =     193.19
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                   (Std. Err. adjusted for 805 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          Subsidy |   6.600908   .6142659    10.75   0.000     5.396969    7.804847
          2.Study |  -.0595946   .8117043    -0.07   0.941    -1.650506    1.531317
Baseline_TotalTFV |   .1537666   .0500717     3.07   0.002     .0556278    .2519054
                  |
             Wave |
               2  |  -.8252421   1.282075    -0.64   0.520    -3.338064    1.687579
               3  |  -1.548633   1.025652    -1.51   0.131    -3.558874     .461608
               4  |   1.117845    1.67415     0.67   0.504    -2.163429    4.399119
               5  |   -2.29715   1.060634    -2.17   0.030    -4.375955   -.2183457
               6  |  -2.981945   .9654404    -3.09   0.002    -4.874173   -1.089716
               7  |  -3.799284     .77839    -4.88   0.000      -5.3249   -2.273668
               8  |  -2.799863   1.448785    -1.93   0.053    -5.639429     .039702
              10  |          0  (omitted)
                  |
            _cons |   4.207271   .7472627     5.63   0.000     2.742663    5.671879
------------------+----------------------------------------------------------------
          sigma_u |  6.2184386
          sigma_e |  8.4009293
              rho |  .35396698   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. est sto T2PAC3

. reg TotalTFV Subsidy i.Study Baseline_TotalTFV i.Wave if Week==1, cl(agentid)
note: 10.Wave omitted because of collinearity

Linear regression                               Number of obs     =        781
                                                F(10, 780)        =      13.24
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0891
                                                Root MSE          =     11.333

                                   (Std. Err. adjusted for 781 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          Subsidy |   7.888403   .8881593     8.88   0.000     6.144938    9.631869
          2.Study |   1.359369   1.150824     1.18   0.238    -.8997094    3.618447
Baseline_TotalTFV |    .159774   .0534882     2.99   0.003     .0547762    .2647718
                  |
             Wave |
               2  |   .5094026   2.294348     0.22   0.824    -3.994425     5.01323
               3  |   .0417384   1.599651     0.03   0.979    -3.098393     3.18187
               4  |   .8170312   2.170113     0.38   0.707    -3.442922    5.076985
               5  |   -.649852    1.50625    -0.43   0.666    -3.606636    2.306933
               6  |  -2.957204   1.610847    -1.84   0.067    -6.119312    .2049037
               7  |  -2.329362    1.32052    -1.76   0.078    -4.921556    .2628314
               8  |  -3.763116   1.860074    -2.02   0.043     -7.41446   -.1117712
              10  |          0  (omitted)
                  |
            _cons |   4.226744   1.047178     4.04   0.000     2.171123    6.282365
-----------------------------------------------------------------------------------

. xtreg TotalTFV Subsidy i.Study Baseline_TotalTFV i.Wave if MaxWeek==4, re ///
>         cl(agentid)
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      2,456
Group variable: agentid                         Number of groups  =        625

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1654                                         avg =        3.9
     overall = 0.0918                                         max =          4

                                                Wald chi2(10)     =     177.46
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                   (Std. Err. adjusted for 625 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          Subsidy |    6.87154   .6776341    10.14   0.000     5.543401    8.199678
          2.Study |  -.4147571   .8962061    -0.46   0.644    -2.171289    1.341775
Baseline_TotalTFV |    .163579   .0595419     2.75   0.006      .046879    .2802791
                  |
             Wave |
               2  |  -1.052601    1.42288    -0.74   0.459    -3.841394    1.736191
               3  |  -1.946357   1.120147    -1.74   0.082    -4.141804    .2490905
               4  |   .9423171   1.813513     0.52   0.603    -2.612103    4.496737
               5  |  -2.444442   1.178942    -2.07   0.038    -4.755126   -.1337573
               6  |  -2.629499   1.033831    -2.54   0.011    -4.655771   -.6032262
               7  |  -4.902351   .8188483    -5.99   0.000    -6.507264   -3.297438
               8  |   -3.76145   1.871998    -2.01   0.045    -7.430499   -.0924006
              10  |          0  (omitted)
                  |
            _cons |   4.203468   .8306888     5.06   0.000     2.575348    5.831588
------------------+----------------------------------------------------------------
          sigma_u |  6.1332871
          sigma_e |  8.3854258
              rho |  .34852509   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. 
. *Percentage effect size using column (3)
. est restore T2PAC3
(results T2PAC3 are active now)

. disp _b[Subsidy]/_b[_cons]
1.5689286

. 
. *Percentage effect size using column (3)
. disp _b[Subsidy]/c_sd
.98418146

. 
. *Table 2, Panel B
.         *First need to create fractional FV measures
. gen TotalFood = ReceiptTotal - NonFood
(302 missing values generated)

. replace TotalFood = TotalTFV + TotalBG  if NonFood == . | TotalFood < 0 | ///
>         TotalFood < (TotalTFV + TotalBG)
(164 real changes made)

. gen TFV_Ratio = TotalTFV/TotalFood
(321 missing values generated)

. gen TotalFood_Baseline = Baseline_ReceiptTotal-Baseline_NonFood
(1 missing value generated)

. replace TotalFood_Baseline = Baseline_TotalTFV + Baseline_TotalBG if ///
>         Baseline_NonFood == . | TotalFood_Baseline < 0 | TotalFood_Baseline < ///
>         (Baseline_TotalTFV + Baseline_TotalBG)
(121 real changes made)

. gen TFV_Ratio_Baseline = Baseline_TotalTFV/TotalFood_Baseline
(43 missing values generated)

. sum TFV_Ratio if AltTreatmentCode == 1, d 

                          TFV_Ratio
-------------------------------------------------------------
      Percentiles      Smallest
 1%            0              0
 5%            0              0
10%            0              0       Obs                 384
25%            0              0       Sum of Wgt.         384

50%     .0354844                      Mean           .1289423
                        Largest       Std. Dev.      .2162529
75%     .1463482              1
90%     .3780025              1       Variance       .0467653
95%     .5917808              1       Skewness       2.559635
99%            1              1       Kurtosis       9.562933

. xtreg TFV_Ratio Subsidy i.Study, re cl(agentid)

Random-effects GLS regression                   Number of obs     =      2,745
Group variable: agentid                         Number of groups  =        804

R-sq:                                           Obs per group:
     within  =      .                                         min =          1
     between = 0.0840                                         avg =        3.4
     overall = 0.0470                                         max =          4

                                                Wald chi2(2)      =     130.79
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                              (Std. Err. adjusted for 804 clusters in agentid)
------------------------------------------------------------------------------
             |               Robust
   TFV_Ratio |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     Subsidy |   .1469187   .0157686     9.32   0.000     .1160128    .1778246
     2.Study |   .0578055   .0175631     3.29   0.001     .0233825    .0922286
       _cons |   .1270597   .0126401    10.05   0.000     .1022855    .1518339
-------------+----------------------------------------------------------------
     sigma_u |  .14753902
     sigma_e |  .24157212
         rho |  .27167304   (fraction of variance due to u_i)
------------------------------------------------------------------------------

. xtreg TFV_Ratio Subsidy i.Study TFV_Ratio_Baseline, re cl(agentid)

Random-effects GLS regression                   Number of obs     =      2,710
Group variable: agentid                         Number of groups  =        793

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1071                                         avg =        3.4
     overall = 0.0594                                         max =          4

                                                Wald chi2(3)      =     140.44
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                    (Std. Err. adjusted for 793 clusters in agentid)
------------------------------------------------------------------------------------
                   |               Robust
         TFV_Ratio |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
           Subsidy |   .1495096    .016171     9.25   0.000      .117815    .1812041
           2.Study |   .0492184   .0173842     2.83   0.005      .015146    .0832907
TFV_Ratio_Baseline |   .1598048   .0438872     3.64   0.000     .0737874    .2458222
             _cons |   .1066633   .0139034     7.67   0.000     .0794131    .1339134
-------------------+----------------------------------------------------------------
           sigma_u |  .14470691
           sigma_e |  .24142318
               rho |  .26431084   (fraction of variance due to u_i)
------------------------------------------------------------------------------------

. xtreg TFV_Ratio Subsidy i.Study TFV_Ratio_Baseline i.Wave, re cl(agentid)
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      2,710
Group variable: agentid                         Number of groups  =        793

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1221                                         avg =        3.4
     overall = 0.0704                                         max =          4

                                                Wald chi2(10)     =     168.93
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                    (Std. Err. adjusted for 793 clusters in agentid)
------------------------------------------------------------------------------------
                   |               Robust
         TFV_Ratio |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
           Subsidy |   .1548704   .0162461     9.53   0.000     .1230286    .1867121
           2.Study |   .0181169   .0211722     0.86   0.392    -.0233798    .0596136
TFV_Ratio_Baseline |    .157613   .0434919     3.62   0.000     .0723704    .2428556
                   |
              Wave |
                2  |  -.0505987   .0271948    -1.86   0.063    -.1038994    .0027021
                3  |  -.0141588   .0285238    -0.50   0.620    -.0700643    .0417468
                4  |   .0184598   .0412837     0.45   0.655    -.0624548    .0993744
                5  |  -.0674595   .0235807    -2.86   0.004    -.1136768   -.0212422
                6  |  -.0601357   .0273063    -2.20   0.028    -.1136551   -.0066162
                7  |  -.0852528    .023221    -3.67   0.000    -.1307651   -.0397404
                8  |  -.0171637   .0384951    -0.45   0.656    -.0926126    .0582853
               10  |          0  (omitted)
                   |
             _cons |   .1327952   .0179212     7.41   0.000     .0976704    .1679201
-------------------+----------------------------------------------------------------
           sigma_u |  .14343577
           sigma_e |  .24142318
               rho |  .26089385   (fraction of variance due to u_i)
------------------------------------------------------------------------------------

. reg TFV_Ratio Subsidy i.Study TFV_Ratio_Baseline i.Wave if Week==1, cl(agentid)
note: 10.Wave omitted because of collinearity

Linear regression                               Number of obs     =        766
                                                F(10, 765)        =      10.15
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0906
                                                Root MSE          =     .28705

                                    (Std. Err. adjusted for 766 clusters in agentid)
------------------------------------------------------------------------------------
                   |               Robust
         TFV_Ratio |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
           Subsidy |   .1884183   .0262205     7.19   0.000     .1369456    .2398911
           2.Study |   .0278565   .0294462     0.95   0.344    -.0299485    .0856614
TFV_Ratio_Baseline |   .2500052    .064075     3.90   0.000     .1242214    .3757889
                   |
              Wave |
                2  |   .0229042   .0519591     0.44   0.659    -.0790952    .1249036
                3  |   .0282414   .0437392     0.65   0.519    -.0576218    .1141046
                4  |   .0242619   .0627662     0.39   0.699    -.0989526    .1474764
                5  |  -.0559279   .0357874    -1.56   0.119    -.1261811    .0143253
                6  |   .0015213   .0558755     0.03   0.978    -.1081662    .1112089
                7  |  -.0352982   .0365164    -0.97   0.334    -.1069824     .036386
                8  |  -.0467864   .0501969    -0.93   0.352    -.1453264    .0517536
               10  |          0  (omitted)
                   |
             _cons |   .1016727   .0279039     3.64   0.000     .0468955    .1564499
------------------------------------------------------------------------------------

. xtreg TFV_Ratio Subsidy i.Study TFV_Ratio_Baseline i.Wave if MaxWeek==4, re ///
>         cl(agentid)
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      2,410
Group variable: agentid                         Number of groups  =        618

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1578                                         avg =        3.9
     overall = 0.0784                                         max =          4

                                                Wald chi2(10)     =     160.88
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                    (Std. Err. adjusted for 618 clusters in agentid)
------------------------------------------------------------------------------------
                   |               Robust
         TFV_Ratio |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
           Subsidy |   .1578621   .0176644     8.94   0.000     .1232404    .1924837
           2.Study |   .0190691   .0232404     0.82   0.412    -.0264813    .0646195
TFV_Ratio_Baseline |   .1710696   .0458817     3.73   0.000     .0811432     .260996
                   |
              Wave |
                2  |  -.0599876   .0285501    -2.10   0.036    -.1159446   -.0040305
                3  |  -.0159296   .0323443    -0.49   0.622    -.0793232    .0474641
                4  |    .027177   .0435006     0.62   0.532    -.0580826    .1124365
                5  |   -.063418   .0257001    -2.47   0.014    -.1137892   -.0130468
                6  |  -.0512815   .0291832    -1.76   0.079    -.1084795    .0059164
                7  |  -.1072087   .0251479    -4.26   0.000    -.1564976   -.0579197
                8  |  -.0379581   .0508806    -0.75   0.456    -.1376821     .061766
               10  |          0  (omitted)
                   |
             _cons |   .1359914   .0193952     7.01   0.000     .0979775    .1740052
-------------------+----------------------------------------------------------------
           sigma_u |  .14768273
           sigma_e |  .23995356
               rho |   .2747294   (fraction of variance due to u_i)
------------------------------------------------------------------------------------

.         
. *Test of FV distribution by subsidy 
. ksmirnov TotalTFV, by(Subsidy) exact

Two-sample Kolmogorov-Smirnov test for equality of distribution functions

 Smaller group       D       P-value      Exact
 ----------------------------------------------
 0:                  0.3726    0.000
 1:                 -0.0001    1.000
 Combined K-S:       0.3726    0.000          .

Note: Ties exist in combined dataset;
      there are 1507 unique values out of 2767 observations.

. 
. *** Section 4.2 ***
. 
. *Figure 1, Panel A
.         *First, create a new treatment code with a more intuitive order for the 
.         *figure.  Also need to create treatment means, SDs, and SEs for the figure
. gen NewTreatment = AltTreatmentCode
(299 missing values generated)

. recode NewTreatment (4=5) (5=4)
(NewTreatment: 715 changes made)

. foreach var in TFV BG {
  2. egen Mean_Total`var' = mean(Total`var'), by(NewTreatment)
  3. egen SD_Total`var' = sd(Total`var'), by(NewTreatment)
  4. egen N_Total`var' = count(1), by(NewTreatment)
  5. gen TopBar_`var' = Mean_Total`var'+1.96*SD_Total`var'/sqrt(N_Total`var')
  6. gen BottomBar_`var' = Mean_Total`var'-1.96*SD_Total`var'/sqrt(N_Total`var')
  7. }
(299 missing values generated)
(299 missing values generated)
(299 missing values generated)
(299 missing values generated)
(299 missing values generated)
(299 missing values generated)
(299 missing values generated)
(299 missing values generated)

. twoway bar Mean_TotalTFV NewTreatment if NewTreatment < 6, barwidth(0.85) ///
>         lcolor(gs6) fcolor(gs6) || ///
>         rcap TopBar_TFV BottomBar_TFV NewTreatment if NewTreatment < 6, ///
>                 lcolor(black) ///
>         xtitle("") xlabel(1 "Control" 2 "Restricted" 3 "Agency" ///
>                 4 `" "Delayed" "Choice" "' 5 `" "Early" "Choice" "', ///
>                 labsize(medlarge) nogrid valuelabels)  ylabel(0 "$0"  4 "$4"  8 "$8" ///
>                 12 "$12", angle(horizontal) labsize(medlarge)) ytick(0(2)14) ///
>         ytitle("", size(medlarge)) xsize(8) legend(off) name(Means_TFV, replace) ///
>         subtitle(Panel A: Mean Spending on Fruits and Vegetables, ///
>                 size(medlarge)) ///
>         nodraw

.         
. *Figure 1, Panel B
. twoway bar Mean_TotalBG NewTreatment if NewTreatment < 6, barwidth(0.85) ///
>         lcolor(gs6) fcolor(gs6) || ///
>         rcap TopBar_BG BottomBar_BG NewTreatment if NewTreatment < 6, ///
>                 lcolor(black) ///
>         xtitle("") xlabel(1 "Control" 2 "Restricted" 3 "Agency" ///
>         4 `" "Delayed" "Choice" "' 5 `" "Early" "Choice" "', ///
>         labsize(medlarge) nogrid)  ylabel(0 "$0"  4 "$4"  8 "$8" 12 "$12", ///
>         angle(horizontal) labsize(medlarge) ) ytitle("", size(medlarge)) ///
>         ytick(0(2)14) xsize(8) name(Means_BG, replace) ///
>         subtitle(Panel B: Mean Spending on Baked Goods, size(medlarge)) ///
>         legend(order(1 "Mean" 2 "95% C.I.") position(12) rows(1) ring(0) ///
>         bmargin(medium) region(col(white)) size(medlarge)) nodraw

. 
. *Figure 1, Panel C
. xtreg TotalTFV i.NewTreatment Baseline_TotalTFV i.Wave if Study == 1, re ///
>         cl(agentid)
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      1,936
Group variable: agentid                         Number of groups  =        568

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1520                                         avg =        3.4
     overall = 0.0958                                         max =          4

                                                Wald chi2(12)     =          .
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =          .

                                   (Std. Err. adjusted for 568 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
     NewTreatment |
               2  |   4.959738   .7960465     6.23   0.000     3.399515    6.519961
               3  |   5.927473   .7664301     7.73   0.000     4.425298    7.429649
               4  |   7.206948   .9217116     7.82   0.000     5.400427     9.01347
               5  |   8.115361   .9940179     8.16   0.000     6.167122     10.0636
               6  |          0  (empty)
               7  |          0  (empty)
                  |
Baseline_TotalTFV |   .0826952   .0461865     1.79   0.073    -.0078286     .173219
                  |
             Wave |
               2  |  -.7984367   1.336812    -0.60   0.550    -3.418541    1.821668
               3  |   -1.45541   .9938464    -1.46   0.143    -3.403313    .4924934
               4  |   1.330736   1.657278     0.80   0.422    -1.917469    4.578941
               5  |  -2.286737   1.003824    -2.28   0.023    -4.254195   -.3192787
               6  |  -2.778299   .9458484    -2.94   0.003    -4.632128   -.9244701
               7  |  -3.727714   .7753793    -4.81   0.000    -5.247429   -2.207998
               8  |  -2.931658   1.451356    -2.02   0.043    -5.776265    -.087052
              10  |          0  (empty)
                  |
            _cons |   4.598622   .7208262     6.38   0.000     3.185829    6.011416
------------------+----------------------------------------------------------------
          sigma_u |  5.3076938
          sigma_e |  8.3378066
              rho |  .28837579   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. coefplot, keep(2.NewTreatment 3.NewTreatment 4.NewTreatment 5.NewTreatment) ///
>         vertical levels(99 95 90) msymbol(d) mcolor(white) msize(medlarge) ///
>         ciopts(lwidth(8 ..) lcolor(gs12 gs8 gs4)) yline(0, lcolor(gs2)) ///
>         graphregion(color(white)) legend(off) ///
>         coeflabels(2.NewTreatment = "Restricted" 3.NewTreatment = "Agency" ///
>         4.NewTreatment =`" "Delayed" "Choice" "' ///
>         5.NewTreatment = `" "Early" "Choice" "', labsize(medlarge)) ///
>         ytitle("", size(medlarge)) ylabel(0 "0%" 4.03 "+100%" 8.06 "+200%", ///
>         labsize(medlarge)) ytick(-2.015(2.015)10.075) ///
>         subtitle(Panel C: Relative-to-Control FV Treatment Effects, ///
>         size(medlarge)) name(coeffs_FV, replace) nodraw

. 
. *Figure 1, Panel D
. xtreg TotalBG i.NewTreatment Baseline_TotalBG i.Wave if Study == 1, re ///
>         cl(agentid)
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      1,936
Group variable: agentid                         Number of groups  =        568

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.0602                                         avg =        3.4
     overall = 0.0253                                         max =          4

                                                Wald chi2(12)     =          .
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =          .

                                  (Std. Err. adjusted for 568 clusters in agentid)
----------------------------------------------------------------------------------
                 |               Robust
         TotalBG |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
    NewTreatment |
              2  |  -1.042963    1.01997    -1.02   0.307    -3.042068    .9561424
              3  |   .2640711   1.016363     0.26   0.795    -1.727964    2.256106
              4  |   1.774088   1.191091     1.49   0.136     -.560407    4.108583
              5  |  -.0077509   1.128892    -0.01   0.995    -2.220338    2.204836
              6  |          0  (empty)
              7  |          0  (empty)
                 |
Baseline_TotalBG |  -.0089155   .0089486    -1.00   0.319    -.0264544    .0086233
                 |
            Wave |
              2  |   1.625641     1.0973     1.48   0.138    -.5250272     3.77631
              3  |   .3149957   1.061247     0.30   0.767    -1.765011    2.395002
              4  |  -.0692848   1.498546    -0.05   0.963    -3.006381    2.867811
              5  |     .75239   1.224243     0.61   0.539    -1.647083    3.151863
              6  |  -.6995938   1.211343    -0.58   0.564    -3.073783    1.674595
              7  |  -3.733024   .7336232    -5.09   0.000    -5.170899   -2.295149
              8  |  -5.609142   .8793517    -6.38   0.000     -7.33264   -3.885644
             10  |          0  (empty)
                 |
           _cons |   8.476191    1.10162     7.69   0.000     6.317055    10.63533
-----------------+----------------------------------------------------------------
         sigma_u |  2.7892157
         sigma_e |  12.137325
             rho |  .05016123   (fraction of variance due to u_i)
----------------------------------------------------------------------------------

. coefplot, keep(2.NewTreatment 3.NewTreatment 4.NewTreatment 5.NewTreatment) ///
>         vertical levels(99 95 90) msymbol(d) mcolor(white) msize(medlarge) ///
>         ciopts(lwidth(8 ..) lcolor(gs12 gs8 gs4)) yline(0, lcolor(gs2)) ///
>         graphregion(color(white)) legend(order(1 "99% CI" 2 "95% CI" 3 "90% CI") /// 
>         position(12) rows(1) ring(0) bmargin(large) region(col(white)) ///
>         size(medlarge)) coeflabels(2.NewTreatment = "Restricted" ///
>         3.NewTreatment = "Agency" 4.NewTreatment = `" "Delayed" "Choice" "' ///
>         5.NewTreatment = `" "Early" "Choice" "', labsize(medlarge)) xsize(8) ///
>         ytitle("", size(medlarge)) ylabel(0 "0%" 8 "+100%" 16 "+200%", ///
>         labsize(medlarge)) ytick(-4(4)20) ///
>         subtitle(Panel D: Relative-to-Control BG Treatment Effects, ///
>         size(medlarge)) name(coeffs_BG, replace) nodraw

. 
. *Figure 1
. graph combine Means_TFV Means_BG coeffs_FV coeffs_BG, cols(2) rows(2) ///
>         iscale(0.65) name(Figure1, replace)

. graph display Figure1, xsize(8.5) ysize(5.5) 

. graph export Figure1.pdf, replace
(file /Users/mkuhn/Dropbox (University of Oregon)/AlexAndyMike_Groceries/Submission/REStat/Pub Material/Data & Code/Figur
> e1.pdf written in PDF format)

. 
. *Unadjusted mean difference between control and early-choice waiting period
. sum TotalTFV if AltTreatmentCode == 1 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        388    4.028389    6.707003          0     56.255

. scalar c_mean = `r(mean)'

. sum TotalTFV if AltTreatmentCode == 4

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        349    12.17301    12.39823          0      65.79

. scalar ecwp_mean = `r(mean)'

. disp ecwp_mean - c_mean
8.1446194

. 
. *Percentage overall effect of full behavioral food subsidy
. xtreg TotalTFV i.AltTreatmentCode i.Study Baseline_TotalTFV i.Wave, re ///
>         cl(agentid)
note: 2.Study omitted because of collinearity
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      2,767
Group variable: agentid                         Number of groups  =        805

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1360                                         avg =        3.4
     overall = 0.0893                                         max =          4

                                                Wald chi2(14)     =     198.31
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                   (Std. Err. adjusted for 805 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
 AltTreatmentCode |
               2  |   5.112843   .8119605     6.30   0.000     3.521429    6.704256
               3  |   5.951036    .775277     7.68   0.000     4.431521    7.470551
               4  |   8.229984   .9965215     8.26   0.000     6.276838    10.18313
               5  |   7.336284   .9171576     8.00   0.000     5.538689     9.13388
               6  |   6.148292   1.037565     5.93   0.000     4.114701    8.181882
               7  |   7.137645    1.07998     6.61   0.000     5.020924    9.254367
                  |
          2.Study |          0  (omitted)
Baseline_TotalTFV |   .1552443   .0488282     3.18   0.001     .0595427    .2509458
                  |
             Wave |
               2  |  -.6773449   1.321754    -0.51   0.608    -3.267934    1.913244
               3  |  -1.485187   1.009244    -1.47   0.141    -3.463268    .4928947
               4  |    1.22813   1.647334     0.75   0.456    -2.000586    4.456846
               5  |  -2.227207    1.00978    -2.21   0.027     -4.20634   -.2480743
               6  |  -2.674159   .9431864    -2.84   0.005     -4.52277   -.8255477
               7  |  -3.651046   .7889984    -4.63   0.000    -5.197454   -2.104638
               8  |  -2.896822   1.443911    -2.01   0.045    -5.726834    -.066809
              10  |          0  (omitted)
                  |
            _cons |   4.127798   .7377736     5.59   0.000     2.681788    5.573807
------------------+----------------------------------------------------------------
          sigma_u |  6.1830495
          sigma_e |  8.4009293
              rho |  .35136115   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. nlcom (effect: _b[4.AltTreatmentCode]/_b[_cons])

      effect:  _b[4.AltTreatmentCode]/_b[_cons]

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |   1.993796   .4971538     4.01   0.000     1.019392    2.968199
------------------------------------------------------------------------------

. 
. *Percentage effect of full behavioral subsidy relative to subsidy alone
. nlcom (effect: _b[4.AltTreatmentCode]/_b[2.AltTreatmentCode] - 1)

      effect:  _b[4.AltTreatmentCode]/_b[2.AltTreatmentCode] - 1

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |    .609669   .2723433     2.24   0.025      .075886    1.143452
------------------------------------------------------------------------------

. 
. *Overall FV subsidy selection
. sum TFV if choice == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         TFV |      1,188    .7794613    .4147845          0          1

. 
. *Treatment subsidy selection rates
. sum TFV if AltTreatmentCode == 3

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         TFV |        473    .7632135    .4255602          0          1

. sum TFV if AltTreatmentCode == 5

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         TFV |        366    .7868852    .4100687          0          1

. sum TFV if AltTreatmentCode == 4

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
         TFV |        349    .7936963    .4052321          0          1

. 
. *Subsidy selection rate tests
. xtreg TFV i.AltTreatmentCode if choice == 1, cl(agentid) re

Random-effects GLS regression                   Number of obs     =      1,188
Group variable: agentid                         Number of groups  =        356

R-sq:                                           Obs per group:
     within  =      .                                         min =          1
     between = 0.0002                                         avg =        3.3
     overall = 0.0010                                         max =          4

                                                Wald chi2(2)      =          .
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =          .

                                  (Std. Err. adjusted for 356 clusters in agentid)
----------------------------------------------------------------------------------
                 |               Robust
             TFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-----------------+----------------------------------------------------------------
AltTreatmentCode |
              2  |          0  (empty)
              3  |   -.014327   .0364561    -0.39   0.694    -.0857797    .0571257
              4  |    .009413   .0405269     0.23   0.816    -.0700182    .0888442
              5  |          0  (omitted)
              6  |          0  (empty)
              7  |          0  (empty)
                 |
           _cons |   .7804237   .0271995    28.69   0.000     .7271137    .8337337
-----------------+----------------------------------------------------------------
         sigma_u |  .22183545
         sigma_e |  .35637509
             rho |  .27926793   (fraction of variance due to u_i)
----------------------------------------------------------------------------------

. test  3.AltTreatmentCode = 4.AltTreatmentCode = 0

 ( 1)  3.AltTreatmentCode - 4.AltTreatmentCode = 0
 ( 2)  3.AltTreatmentCode = 0

           chi2(  2) =    0.40
         Prob > chi2 =    0.8187

. 
. *Table 3
. sum TotalTFV if AltTreatmentCode == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    TotalTFV |        388    4.028389    6.707003          0     56.255

. xtreg TotalTFV Subsidy choice wp i.Study, re cl(agentid)

Random-effects GLS regression                   Number of obs     =      2,767
Group variable: agentid                         Number of groups  =        805

R-sq:                                           Obs per group:
     within  =      .                                         min =          1
     between = 0.0904                                         avg =        3.4
     overall = 0.0561                                         max =          4

                                                Wald chi2(4)      =     143.13
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                              (Std. Err. adjusted for 805 clusters in agentid)
------------------------------------------------------------------------------
             |               Robust
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     Subsidy |    4.77226   .8233024     5.80   0.000     3.158617    6.385903
      choice |   .7533271   .8738444     0.86   0.389    -.9593763    2.466031
          wp |   1.607739   .6976196     2.30   0.021     .2404296    2.975048
     2.Study |   2.204775   .9475775     2.33   0.020     .3475577    4.061993
       _cons |    4.02274   .4762585     8.45   0.000      3.08929    4.956189
-------------+----------------------------------------------------------------
     sigma_u |  6.3864637
     sigma_e |  8.4009293
         rho |  .36625351   (fraction of variance due to u_i)
------------------------------------------------------------------------------

. xtreg TotalTFV Subsidy choice wp Baseline_TotalTFV i.Study, re cl(agentid)

Random-effects GLS regression                   Number of obs     =      2,767
Group variable: agentid                         Number of groups  =        805

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1157                                         avg =        3.4
     overall = 0.0731                                         max =          4

                                                Wald chi2(5)      =     159.72
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                   (Std. Err. adjusted for 805 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          Subsidy |   5.059909    .834327     6.06   0.000     3.424658     6.69516
           choice |   .6157835   .8789239     0.70   0.484    -1.106876    2.338443
               wp |   1.688369   .6811142     2.48   0.013     .3534101    3.023329
Baseline_TotalTFV |   .1585392    .049859     3.18   0.001     .0608173    .2562611
          2.Study |   1.827387   .9497532     1.92   0.054    -.0340949    3.688869
            _cons |   3.042155   .5278027     5.76   0.000     2.007681    4.076629
------------------+----------------------------------------------------------------
          sigma_u |  6.2469445
          sigma_e |  8.4009293
              rho |   .3560615   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. xtreg TotalTFV Subsidy choice wp Baseline_TotalTFV i.Study i.Wave, re ///
>         cl(agentid)
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      2,767
Group variable: agentid                         Number of groups  =        805

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1355                                         avg =        3.4
     overall = 0.0883                                         max =          4

                                                Wald chi2(12)     =     198.00
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                   (Std. Err. adjusted for 805 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          Subsidy |   5.113028   .8118253     6.30   0.000     3.521879    6.704176
           choice |   1.063934   .8705137     1.22   0.222    -.6422419    2.770109
               wp |   1.455984   .6715608     2.17   0.030     .1397486    2.772219
Baseline_TotalTFV |   .1541921   .0489429     3.15   0.002     .0582658    .2501185
          2.Study |   .7897632   .9976805     0.79   0.429    -1.165655    2.745181
                  |
             Wave |
               2  |  -.7469758   1.309196    -0.57   0.568    -3.312952    1.819001
               3  |  -1.469004   1.011086    -1.45   0.146    -3.450696    .5126879
               4  |   1.197415   1.636768     0.73   0.464    -2.010591    4.405421
               5  |  -2.228685   1.018122    -2.19   0.029    -4.224168   -.2332025
               6  |  -2.752285   .9511409    -2.89   0.004    -4.616487   -.8880832
               7  |  -3.802685   .7861954    -4.84   0.000    -5.343599    -2.26177
               8  |  -2.940907     1.4391    -2.04   0.041    -5.761491   -.1203219
              10  |          0  (omitted)
                  |
            _cons |   4.161999   .7400324     5.62   0.000     2.711562    5.612436
------------------+----------------------------------------------------------------
          sigma_u |  6.1733344
          sigma_e |  8.4009293
              rho |  .35064473   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. est store T3C3

. reg TotalTFV Subsidy choice wp Baseline_TotalTFV i.Study i.Wave if ///
>         Week==1, cl(agentid)
note: 10.Wave omitted because of collinearity

Linear regression                               Number of obs     =        781
                                                F(12, 780)        =      11.91
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1112
                                                Root MSE          =     11.209

                                   (Std. Err. adjusted for 781 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          Subsidy |   6.902431   1.270262     5.43   0.000     4.408895    9.395968
           choice |  -1.143287   1.339355    -0.85   0.394    -3.772455    1.485881
               wp |   4.047748    .980761     4.13   0.000     2.122504    5.972992
Baseline_TotalTFV |   .1621158   .0512233     3.16   0.002      .061564    .2626676
          2.Study |   .5290711   1.444488     0.37   0.714    -2.306473    3.364615
                  |
             Wave |
               2  |   .5616909   2.334798     0.24   0.810    -4.021541    5.144922
               3  |   .2008471   1.580606     0.13   0.899    -2.901899    3.303593
               4  |    .796304   2.136191     0.37   0.709    -3.397059    4.989667
               5  |  -.5758255   1.411238    -0.41   0.683      -3.3461    2.194449
               6  |  -2.758151   1.518033    -1.82   0.070    -5.738064    .2217621
               7  |  -1.992521    1.33232    -1.50   0.135    -4.607878    .6228366
               8  |  -3.562725   1.825208    -1.95   0.051    -7.145628    .0201774
              10  |          0  (omitted)
                  |
            _cons |   4.126021   1.035462     3.98   0.000     2.093398    6.158644
-----------------------------------------------------------------------------------

. xtreg TotalTFV Subsidy choice wp Baseline_TotalTFV i.Study i.Wave if ///
>         MaxWeek==4, re cl(agentid)
note: 10.Wave omitted because of collinearity

Random-effects GLS regression                   Number of obs     =      2,456
Group variable: agentid                         Number of groups  =        625

R-sq:                                           Obs per group:
     within  =      .                                         min =          1
     between = 0.1777                                         avg =        3.9
     overall = 0.0995                                         max =          4

                                                Wald chi2(12)     =     183.72
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000

                                   (Std. Err. adjusted for 625 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          Subsidy |   5.073816   .8696722     5.83   0.000      3.36929    6.778342
           choice |   1.548219   .9425538     1.64   0.100    -.2991529     3.39559
               wp |   1.347787   .7365082     1.83   0.067    -.0957421    2.791317
Baseline_TotalTFV |   .1640271   .0581737     2.82   0.005     .0500088    .2780454
          2.Study |   .8329418   1.101035     0.76   0.449    -1.325047    2.990931
                  |
             Wave |
               2  |  -.8962135   1.444427    -0.62   0.535    -3.727239    1.934812
               3  |  -1.962322   1.095191    -1.79   0.073    -4.108857     .184214
               4  |   1.057442   1.770604     0.60   0.550    -2.412879    4.527763
               5  |  -2.414464   1.129699    -2.14   0.033    -4.628635    -.200294
               6  |  -2.338894   1.036441    -2.26   0.024    -4.370281   -.3075083
               7  |   -4.95866   .8186773    -6.06   0.000    -6.563238   -3.354082
               8  |    -3.8859   1.880504    -2.07   0.039    -7.571621   -.2001791
              10  |          0  (omitted)
                  |
            _cons |   4.165229   .8213269     5.07   0.000     2.555458       5.775
------------------+----------------------------------------------------------------
          sigma_u |  6.0804983
          sigma_e |  8.3854258
              rho |  .34461002   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

.         
. *Percentage effect of subsidy with agency relative to subsidy without
. est restore T3C3
(results T3C3 are active now)

. disp _b[choice]/_b[Subsidy]
.20808289

. 
. *Rejectable negative effect size of agency subisdy relative to restricted
. test choice = -0.64

 ( 1)  choice = -.64

           chi2(  1) =    3.83
         Prob > chi2 =    0.0503

. test choice = -0.65

 ( 1)  choice = -.65

           chi2(  1) =    3.88
         Prob > chi2 =    0.0490

. 
. *Percentage effect of subsidy with waiting period relative to subsidy without
. est restore T3C3
(results T3C3 are active now)

. nlcom (effect: _b[wp]/_b[Subsidy])

      effect:  _b[wp]/_b[Subsidy]

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |   .2847596   .1387917     2.05   0.040     .0127329    .5567862
------------------------------------------------------------------------------

. 
. *WP Effect without agency from Part 2 only
. xtreg TotalTFV wp if Study == 2, re cl(agentid)

Random-effects GLS regression                   Number of obs     =        831
Group variable: agentid                         Number of groups  =        237

R-sq:                                           Obs per group:
     within  =      .                                         min =          1
     between = 0.0047                                         avg =        3.5
     overall = 0.0017                                         max =          4

                                                Wald chi2(1)      =       0.91
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.3412

                              (Std. Err. adjusted for 237 clusters in agentid)
------------------------------------------------------------------------------
             |               Robust
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          wp |   1.143727   1.201705     0.95   0.341    -1.211572    3.499026
       _cons |   11.24739   .7948872    14.15   0.000      9.68944    12.80534
-------------+----------------------------------------------------------------
     sigma_u |  8.1581674
     sigma_e |  8.5445294
         rho |  .47688066   (fraction of variance due to u_i)
------------------------------------------------------------------------------

. 
. *Baseline to endline effect of wp
.         *First need to generate difference variable
. gen diff_TFV = Endline_TotalTFV - Baseline_TotalTFV
(687 missing values generated)

. reg diff_TFV wp i.Wave if id_tag == 1 & Subsidy == 1 & Study == 1, r

Linear regression                               Number of obs     =        343
                                                F(8, 334)         =       1.17
                                                Prob > F          =     0.3166
                                                R-squared         =     0.0282
                                                Root MSE          =     11.945

------------------------------------------------------------------------------
             |               Robust
    diff_TFV |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          wp |   2.643997   1.293688     2.04   0.042     .0991942      5.1888
             |
        Wave |
          2  |   3.534681   2.816385     1.26   0.210    -2.005407    9.074768
          3  |   -1.88653   3.847021    -0.49   0.624    -9.453974    5.680913
          4  |   .1713128   2.461807     0.07   0.945    -4.671288    5.013913
          5  |  -1.565617    2.05163    -0.76   0.446    -5.601362    2.470128
          6  |   3.141757   2.625284     1.20   0.232    -2.022418    8.305931
          7  |  -1.015604   1.334326    -0.76   0.447    -3.640347    1.609138
          8  |    .021813   1.521998     0.01   0.989    -2.972097    3.015723
             |
       _cons |  -.7116447   .9534817    -0.75   0.456    -2.587231    1.163942
------------------------------------------------------------------------------

. 
. *Table 4
. xtreg TotalTFV delayed early Baseline_TotalTFV i.Wave if ///
>         AltTreatmentCode == 2 | AltTreatmentCode == 4 | ///
>         AltTreatmentCode == 5, re cl(agentid)

Random-effects GLS regression                   Number of obs     =      1,075
Group variable: agentid                         Number of groups  =        327

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.0629                                         avg =        3.3
     overall = 0.0457                                         max =          4

                                                Wald chi2(10)     =          .
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =          .

                                   (Std. Err. adjusted for 327 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          delayed |   2.422614   1.040028     2.33   0.020     .3841964    4.461031
            early |   3.184744   1.080224     2.95   0.003     1.067543    5.301945
Baseline_TotalTFV |   .0980327   .0725235     1.35   0.176    -.0441108    .2401762
                  |
             Wave |
               2  |  -.7249537   1.954476    -0.37   0.711    -4.555656    3.105749
               3  |  -1.395472   1.295259    -1.08   0.281    -3.934133    1.143189
               4  |   1.889562   2.714048     0.70   0.486    -3.429873    7.208998
               5  |  -1.304094   1.512427    -0.86   0.389    -4.268397    1.660209
               6  |  -1.816024   1.416179    -1.28   0.200    -4.591683    .9596349
               7  |  -4.637705    1.12462    -4.12   0.000     -6.84192    -2.43349
               8  |  -2.603296   2.352421    -1.11   0.268    -7.213956    2.007364
              10  |          0  (empty)
                  |
            _cons |   9.323982   .9137571    10.20   0.000     7.533051    11.11491
------------------+----------------------------------------------------------------
          sigma_u |  5.9288766
          sigma_e |  9.0430655
              rho |  .30062426   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. est store T4C1

. test delayed = early

 ( 1)  delayed - early = 0

           chi2(  1) =    0.41
         Prob > chi2 =    0.5223

. reg TotalTFV delayed early Baseline_TotalTFV i.Wave if ///
>         (AltTreatmentCode == 2 | AltTreatmentCode == 4 | ///
>         AltTreatmentCode == 5) & Week == 1, cl(agentid)

Linear regression                               Number of obs     =        308
                                                F(10, 307)        =       1.40
                                                Prob > F          =     0.1783
                                                R-squared         =     0.0433
                                                Root MSE          =     12.154

                                   (Std. Err. adjusted for 308 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          delayed |   1.977666   1.571244     1.26   0.209    -1.114105    5.069437
            early |   5.016568   1.814134     2.77   0.006     1.446858    8.586279
Baseline_TotalTFV |   .1015758   .0948757     1.07   0.285    -.0851131    .2882646
                  |
             Wave |
               2  |  -.2891467    3.37337    -0.09   0.932    -6.926999    6.348706
               3  |   1.257595   2.478397     0.51   0.612    -3.619199    6.134389
               4  |   1.655194   3.426005     0.48   0.629     -5.08623    8.396617
               5  |   1.853512   2.052257     0.90   0.367    -2.184757    5.891781
               6  |  -1.193911   2.422982    -0.49   0.623    -5.961663    3.573842
               7  |  -1.732845   2.166633    -0.80   0.424    -5.996176    2.530486
               8  |  -3.156614   3.136972    -1.01   0.315      -9.3293    3.016072
                  |
            _cons |   10.71682   1.330054     8.06   0.000     8.099642    13.33399
-----------------------------------------------------------------------------------

. test delayed = early

 ( 1)  delayed - early = 0

       F(  1,   307) =    2.67
            Prob > F =    0.1034

. xtreg TotalTFV delayed early Baseline_TotalTFV i.Wave if ///
>         (AltTreatmentCode == 2 | AltTreatmentCode == 4 | ///
>         AltTreatmentCode == 5) & MaxWeek == 4, re cl(agentid)

Random-effects GLS regression                   Number of obs     =        929
Group variable: agentid                         Number of groups  =        242

R-sq:                                           Obs per group:
     within  = 0.0000                                         min =          1
     between = 0.1185                                         avg =        3.8
     overall = 0.0603                                         max =          4

                                                Wald chi2(10)     =          .
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =          .

                                   (Std. Err. adjusted for 242 clusters in agentid)
-----------------------------------------------------------------------------------
                  |               Robust
         TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
------------------+----------------------------------------------------------------
          delayed |   2.525692   1.186146     2.13   0.033     .2008875    4.850496
            early |   3.976516   1.165026     3.41   0.001     1.693108    6.259925
Baseline_TotalTFV |   .0721791   .0752189     0.96   0.337    -.0752471    .2196054
                  |
             Wave |
               2  |  -.9887888   2.232332    -0.44   0.658     -5.36408    3.386502
               3  |   -2.43797   1.363756    -1.79   0.074    -5.110882    .2349423
               4  |   1.395241    2.85254     0.49   0.625    -4.195635    6.986117
               5  |  -1.815405   1.710124    -1.06   0.288    -5.167185    1.536376
               6  |    -1.7272   1.534079    -1.13   0.260    -4.733941     1.27954
               7  |  -6.061999   1.169059    -5.19   0.000    -8.353312   -3.770686
               8  |   -3.98497   3.146003    -1.27   0.205    -10.15102    2.181081
              10  |          0  (empty)
                  |
            _cons |   9.687252   1.045491     9.27   0.000     7.638127    11.73638
------------------+----------------------------------------------------------------
          sigma_u |  6.1828503
          sigma_e |  9.0243743
              rho |   .3194502   (fraction of variance due to u_i)
-----------------------------------------------------------------------------------

. test delayed = early

 ( 1)  delayed - early = 0

           chi2(  1) =    1.14
         Prob > chi2 =    0.2865

. 
. *Percentage effect of subsidy with delayed waiting period relative to 
. *restricted subsidy
. est restore T4C1
(results T4C1 are active now)

. nlcom (effect: _b[delayed]/_b[_cons])

      effect:  _b[delayed]/_b[_cons]

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |   .2598261   .1239499     2.10   0.036     .0168887    .5027634
------------------------------------------------------------------------------

. 
. *Percentage effect of subsidy with early waiting period relative to 
. *restricted subsidy
. nlcom (effect: _b[early]/_b[_cons])

      effect:  _b[early]/_b[_cons]

------------------------------------------------------------------------------
    TotalTFV |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      effect |   .3415648   .1323961     2.58   0.010     .0820732    .6010564
------------------------------------------------------------------------------

. 
. *** Section 4.3 ***     
. 
. *Percentage choosing smaller FV subsidy over larger BG subsidy
.         *First, need to create reimbursement amount (real and hypothetical), the
.         *the amount gained (or lost) from choosing the FV subsidy, and then an 
.         *indicator for whether someone choosing the FV subsidy lost money by doing
.         *so. We refer to this (casually, not formally) as "commitment".
.         gen TFVReimbursement = 0.3*TotalTFV
(299 missing values generated)

. replace TFVReimbursement = 10 if TFVReimbursement>10
(433 real changes made)

. gen BGReimbursement = 0.3*TotalBG
(299 missing values generated)

. replace BGReimbursement = 10 if BGReimbursement>10
(410 real changes made)

. gen GainFromTFV = TFVReimbursement - BGReimbursement

. gen TFVCommitment = (GainFromTFV < 0) if choice == 1 & TFV == 1 & ///
>         GainFromTFV != .
(2,140 missing values generated)

. tab TFVCommitment

TFVCommitme |
         nt |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        671       72.46       72.46
          1 |        255       27.54      100.00
------------+-----------------------------------
      Total |        926      100.00

. 
. *Money sacrificed by TFV committers
. sum GainFromTFV if TFVCommitment == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
 GainFromTFV |        255   -3.373051    2.949027        -10      -.003

. 
. *Money sacrificed by TFV committers as a percentage of mean subsidy paid
.         *First need to create mean actual subsidy paid
. gen sub_paid = TFVReimbursement if TFV == 1
(949 missing values generated)

. replace sub_paid = BGReimbursement if TFV == 0
(262 real changes made)

. sum GainFromTFV if TFVCommitment == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
 GainFromTFV |        255   -3.373051    2.949027        -10      -.003

. scalar gain_mean = `r(mean)'

. sum sub_paid 

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
    sub_paid |      2,379    3.347832     3.02655          0         10

. scalar sub_mean = `r(mean)'

. disp gain_mean/sub_mean
-1.0075329

. 
. *Percentage choosing smaller BG subsidy over larger FV subsidy
.         *First, create BG corresponding BG commitment variable
. gen BGCommitment = (GainFromTFV > 0) if choice == 1 & TFV == 0 & ///
>         GainFromTFV != .
(2,804 missing values generated)

. tab BGCommitment

BGCommitmen |
          t |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        218       83.21       83.21
          1 |         44       16.79      100.00
------------+-----------------------------------
      Total |        262      100.00

. 
. *Money sacrificed by TFV committers
. sum GainFromTFV if BGCommitment == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
 GainFromTFV |         44    2.161523    2.185571       .042         10

. 
. *Money sacrificed by BG committers as a percentage of mean subsidy paid
. sum GainFromTFV if BGCommitment == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
 GainFromTFV |         44    2.161523    2.185571       .042         10

. scalar gain_mean = `r(mean)'

. disp gain_mean/sub_mean
.64564849

. 
. *FV subsidy shows more commitment than BG subsidy
.         *First, calculate the size of gains from subsidy choice (commitments are 
.         *negative of this), then an indicator for whether that gain is positive (
.         *not committed) 
. gen GainFromChoice = TFVReimbursement - BGReimbursement if TFV == 1 & ///
>         choice == 1
(2,140 missing values generated)

. replace GainFromChoice = BGReimbursement - TFVReimbursement if TFV == 0 & ///
>         choice == 1
(262 real changes made)

. gen GainedFromChoice = (GainFromChoice >= 0) if GainFromChoice != . & ///
>         choice == 1
(1,878 missing values generated)

. xtreg GainedFromChoice TFV, re cl(agentid)

Random-effects GLS regression                   Number of obs     =      1,188
Group variable: agentid                         Number of groups  =        356

R-sq:                                           Obs per group:
     within  = 0.0164                                         min =          1
     between = 0.0023                                         avg =        3.3
     overall = 0.0105                                         max =          4

                                                Wald chi2(1)      =      13.13
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0003

                              (Std. Err. adjusted for 356 clusters in agentid)
------------------------------------------------------------------------------
             |               Robust
GainedFrom~e |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         TFV |  -.1087737   .0300135    -3.62   0.000    -.1675991   -.0499483
       _cons |   .8331851   .0257976    32.30   0.000     .7826227    .8837475
-------------+----------------------------------------------------------------
     sigma_u |  .05454429
     sigma_e |  .42647346
         rho |  .01609415   (fraction of variance due to u_i)
------------------------------------------------------------------------------

. 
. *Average gain from FV subsidy selection
. sum GainFromChoice if TFV == 1

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
GainFromCh~e |        926    1.674018    4.331037        -10         10

. 
. *Average gain from BG subsidy selection
. sum GainFromChoice if TFV == 0

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
GainFromCh~e |        262    2.515166    3.764421        -10         10

. 
. *Difference in gains by choice
. xtreg GainFromChoice TFV if choice == 1, re cl(agentid)

Random-effects GLS regression                   Number of obs     =      1,188
Group variable: agentid                         Number of groups  =        356

R-sq:                                           Obs per group:
     within  = 0.0223                                         min =          1
     between = 0.0003                                         avg =        3.3
     overall = 0.0068                                         max =          4

                                                Wald chi2(1)      =      13.80
corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0002

                              (Std. Err. adjusted for 356 clusters in agentid)
------------------------------------------------------------------------------
             |               Robust
GainFromCh~e |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         TFV |  -1.069535   .2879397    -3.71   0.000    -1.633887    -.505184
       _cons |   2.697328   .2472485    10.91   0.000      2.21273    3.181927
-------------+----------------------------------------------------------------
     sigma_u |  1.7792675
     sigma_e |  3.7887225
         rho |  .18069376   (fraction of variance due to u_i)
------------------------------------------------------------------------------

. 
. *Figure 2
.         *First, need to bin data for presentability
. gen XBin = .
(3,066 missing values generated)

. gen YBin = .
(3,066 missing values generated)

. forvalues i= 1/40 {
  2.     replace XBin =`i' if BGReimbursement >= 0.25*(`i'-1) & ///
>                 BGReimbursement < 0.25*`i'
  3.     replace YBin =`i' if TFVReimbursement >= 0.25*(`i'-1) & ///
>                 TFVReimbursement < 0.25*`i'
  4. }
(1,218 real changes made)
(532 real changes made)
(179 real changes made)
(181 real changes made)
(215 real changes made)
(156 real changes made)
(148 real changes made)
(132 real changes made)
(122 real changes made)
(135 real changes made)
(67 real changes made)
(119 real changes made)
(71 real changes made)
(100 real changes made)
(66 real changes made)
(107 real changes made)
(46 real changes made)
(81 real changes made)
(44 real changes made)
(64 real changes made)
(29 real changes made)
(83 real changes made)
(44 real changes made)
(80 real changes made)
(30 real changes made)
(79 real changes made)
(32 real changes made)
(69 real changes made)
(19 real changes made)
(45 real changes made)
(17 real changes made)
(54 real changes made)
(15 real changes made)
(55 real changes made)
(9 real changes made)
(53 real changes made)
(16 real changes made)
(42 real changes made)
(15 real changes made)
(34 real changes made)
(18 real changes made)
(45 real changes made)
(16 real changes made)
(36 real changes made)
(15 real changes made)
(37 real changes made)
(13 real changes made)
(22 real changes made)
(9 real changes made)
(33 real changes made)
(9 real changes made)
(27 real changes made)
(10 real changes made)
(24 real changes made)
(9 real changes made)
(16 real changes made)
(15 real changes made)
(16 real changes made)
(10 real changes made)
(16 real changes made)
(16 real changes made)
(20 real changes made)
(10 real changes made)
(18 real changes made)
(16 real changes made)
(25 real changes made)
(10 real changes made)
(16 real changes made)
(16 real changes made)
(17 real changes made)
(12 real changes made)
(12 real changes made)
(9 real changes made)
(16 real changes made)
(19 real changes made)
(12 real changes made)
(13 real changes made)
(9 real changes made)
(9 real changes made)
(15 real changes made)

. replace XBin = 40 if BGReimbursement == 10
(410 real changes made)

. replace YBin = 40 if TFVReimbursement == 10
(433 real changes made)

. egen GroupSize = count(1), by(XBin YBin)

. twoway line YBin YBin if TFV == 1 & choice == 1, sort lwidth(medthick) ///
>         lcolor(gs10) lpattern(dash) || ///
>         scatter YBin XBin [fw = GroupSize] if TFV == 1 & choice == 1, ///
>                 msize(vsmall) mcolor(gs4) msymbol(Oh) ///
>         scheme(s2mono) graphregion(color(white)) legend(off) ///
>         ytitle("Subsidy payment from Fruits and Vegetables") ///
>         xtitle("(Counterfactual) subsidy payment from Baked Goods") ///
>         xlabel(9 "$2" 17 "$4" 25 "$6" 33 "$8" 41 "$10") ///
>         ylabel(9 "$2" 17 "$4" 25 "$6" 33 "$8" 41 "$10", angle(horizontal)) ///
>         name(Figure2, replace)

. graph display Figure2, xsize(8.5) ysize(5.5) 

. graph export Figure2.pdf, replace
(file /Users/mkuhn/Dropbox (University of Oregon)/AlexAndyMike_Groceries/Submission/REStat/Pub Material/Data & Code/Figur
> e2.pdf written in PDF format)

. 
. log close
      name:  <unnamed>
       log:  /Users/mkuhn/Dropbox (University of Oregon)/AlexAndyMike_Groceries/Submission/REStat/Pub Material/Data & Cod
> e/BFS Results.log
  log type:  text
 closed on:   9 Jan 2023, 13:34:08
-------------------------------------------------------------------------------------------------------------------------
